﻿<Page x:Name="page"
    x:Class="KincectDoctor.MainPage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:KincectDoctor"
    xmlns:data="using:KincectDoctor.Data"
    xmlns:common="using:KincectDoctor.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Page.Resources>
        <Storyboard x:Name="storyboard" TargetProperty="Opacity"
                RepeatBehavior="Forever" >
            <DoubleAnimation Storyboard.TargetName="title1" BeginTime="0:0:3"
        From="0" To="1" Duration="0:0:3" AutoReverse="True"/>
            <DoubleAnimation Storyboard.TargetName="title2" BeginTime="0:0:6"
        From="0" To="1" Duration="0:0:3" AutoReverse="True"/>
            <DoubleAnimation Storyboard.TargetName="bpm" 
        From="0" To="1" Duration="0:0:3" BeginTime="0:0:14" AutoReverse="True"/>
        </Storyboard>
        <Storyboard x:Name="takeVitals" TargetProperty="Opacity">
            
            <DoubleAnimation Storyboard.TargetName="title3" BeginTime="0:0:2"
        From="0" To="1" Duration="0:0:3" AutoReverse="True"/>
            <DoubleAnimation Storyboard.TargetName="title4" BeginTime="0:0:6"
        From="0" To="1" Duration="0:0:3" AutoReverse="True"/>
            
            <DoubleAnimation Storyboard.TargetName="bpm" 
        From="0" To="1" Duration="0:0:5" AutoReverse="True"/>
        </Storyboard>
        <Storyboard x:Name="showVitalResults" Storyboard.TargetProperty="Opacity">                
        	<DoubleAnimation Storyboard.TargetName="title5" 
        		From="0" To="1" Duration="0:0:3" AutoReverse="True"/>
        	<DoubleAnimation Storyboard.TargetName="title6" 
        		From="0" To="1" Duration="0:0:3" AutoReverse="True"/>
        	<DoubleAnimation Duration="0:0:2.1" To="0.97" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="mainImage" d:IsOptimized="True"/>
            
        </Storyboard>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Grid x:Name="dGrid" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="VSG">
    			<VisualState x:Name="VSG_Attract">
    				<Storyboard RepeatBehavior="Forever">
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontFamily)" Storyboard.TargetName="title1">
    						<DiscreteObjectKeyFrame KeyTime="0:0:0.5">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    						<DiscreteObjectKeyFrame KeyTime="0:0:4.4">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="title1">
    						<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:4.4" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="title2">
    						<EasingDoubleKeyFrame KeyTime="0:0:5" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:10" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="mainImage" d:IsOptimized="True"/>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="VSG_TakingVitals">
    				<Storyboard RepeatBehavior="1x">
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontFamily)" Storyboard.TargetName="title3">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    						<DiscreteObjectKeyFrame KeyTime="0:0:0.48">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    						<DiscreteObjectKeyFrame KeyTime="0:0:1.5">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="title3">
    						<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:0.48" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:1.5" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:3.3" Value="0"/>
    					</DoubleAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontFamily)" Storyboard.TargetName="title4">
    						<DiscreteObjectKeyFrame KeyTime="0:0:3.3">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    						<DiscreteObjectKeyFrame KeyTime="0:0:3.917">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    						<DiscreteObjectKeyFrame KeyTime="0:0:5.081">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="title4">
    						<EasingDoubleKeyFrame KeyTime="0:0:3.3" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:3.917" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:5.081" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:7" Value="0"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="mainImage">
    						<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:1.565" Value="0.391262"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:4" Value="1"/>
    					</DoubleAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Control.FontFamily)" Storyboard.TargetName="page">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    				</Storyboard>
    			</VisualState>
    			<VisualState x:Name="VSG_ShowResults">
    				<Storyboard>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontFamily)" Storyboard.TargetName="title3">
    						<DiscreteObjectKeyFrame KeyTime="0">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="title5">
    						<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:4.3" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:5.1" Value="0"/>
    					</DoubleAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontFamily)" Storyboard.TargetName="title5">
    						<DiscreteObjectKeyFrame KeyTime="0:0:0.5">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    						<DiscreteObjectKeyFrame KeyTime="0:0:4.3">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontFamily)" Storyboard.TargetName="title6">
    						<DiscreteObjectKeyFrame KeyTime="0:0:4.3">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    						<DiscreteObjectKeyFrame KeyTime="0:0:5.2">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    						<DiscreteObjectKeyFrame KeyTime="0:0:8.5">
    							<DiscreteObjectKeyFrame.Value>
    								<FontFamily>Global User Interface</FontFamily>
    							</DiscreteObjectKeyFrame.Value>
    						</DiscreteObjectKeyFrame>
    					</ObjectAnimationUsingKeyFrames>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="title6">
    						<EasingDoubleKeyFrame KeyTime="0:0:4.3" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:5.2" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:8.5" Value="1"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:9.2" Value="0"/>
    					</DoubleAnimationUsingKeyFrames>
    					<DoubleAnimation Duration="0:0:0.6" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="mainImage" d:IsOptimized="True"/>
    				</Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>

        <Image x:Name="mainImage" HorizontalAlignment="Left" Height="768" VerticalAlignment="Top" Width="1366" Stretch="UniformToFill" Opacity="0"  />
        <Canvas x:Name="canvasImage" HorizontalAlignment="Left" Height="768" VerticalAlignment="Top" Width="1366" Margin="0,0,0,0">
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
      Opacity="0" FontSize="100" Name="title1" Margin="100, 300, 100, 100">Please stand closer...</TextBlock>
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
      Opacity="0" FontSize="100" Name="title2"  Margin="100, 300, 100, 100">I'd like to take your vitals...
            </TextBlock>
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
      Opacity="0" FontSize="100" Name="title3"  Margin="100, 300, 100, 100">Please be patient...
            </TextBlock>
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
      Opacity="0" FontSize="100" Name="title4" Margin="100">I'm taking your heart rate
            </TextBlock>
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
      Opacity="0" FontSize="100" Name="title5"  Margin="100, 300, 100, 100">
      </TextBlock>
            <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center"
      Opacity="0" FontSize="100" Name="title6"  Margin="100, 300, 100, 100">
            </TextBlock>
            <TextBlock x:Name="PersonStatus1" TextWrapping="Wrap" Text="Status: Tracking" FontFamily="Segoe UI" FontWeight="Bold" FontSize="36" Visibility="Collapsed">
                <TextBlock.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF0C4BC7" Offset="0"/>
                        <GradientStop Color="#FF8E8388" Offset="0.997"/>
                    </LinearGradientBrush>
                </TextBlock.Foreground>
            </TextBlock>
            <TextBlock x:Name="PersonStatus2" TextWrapping="Wrap" Text="Status: Tracking" FontWeight="Bold" FontFamily="Segoe UI" FontSize="36"  Visibility="Collapsed">
                <TextBlock.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF0C4BC7" Offset="0"/>
                        <GradientStop Color="#FF8E8388" Offset="0.997"/>
                    </LinearGradientBrush>
                </TextBlock.Foreground>
            </TextBlock>
            <TextBlock x:Name="PersonStatus3"  TextWrapping="Wrap" Text="Status: Tracking" FontWeight="Bold"  FontFamily="Segoe UI" FontSize="36"  Foreground="Red" Visibility="Collapsed"/>
            <TextBlock x:Name="PersonStatus4" TextWrapping="Wrap" Text="Status: Tracking"  FontFamily="Segoe UI" FontSize="36"   Visibility="Collapsed">
                <TextBlock.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF0C4BC7" Offset="0"/>
                        <GradientStop Color="#FF8E8388" Offset="0.997"/>
                    </LinearGradientBrush>
                </TextBlock.Foreground>
            </TextBlock>
            <TextBlock x:Name="PersonStatus5" TextWrapping="Wrap" Text="Status: Tracking" FontWeight="Bold" FontFamily="Segoe UI" FontSize="36"   Visibility="Collapsed">
                <TextBlock.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF0C4BC7" Offset="0"/>
                        <GradientStop Color="#FF8E8388" Offset="0.997"/>
                    </LinearGradientBrush>
                </TextBlock.Foreground>
            </TextBlock>
            <TextBlock x:Name="PersonStatus6" TextWrapping="Wrap" Text="Status: Tracking" FontWeight="Bold" FontFamily="Segoe UI" FontSize="36"   Visibility="Collapsed">
                <TextBlock.Foreground>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF0C4BC7" Offset="0"/>
                        <GradientStop Color="#FF8E8388" Offset="0.997"/>
                    </LinearGradientBrush>
                </TextBlock.Foreground>
            </TextBlock>
        </Canvas>
        <TextBlock x:Name="bpm" TextWrapping="Wrap" Text="Hello I am your Kinect Virtual Doctor"  FontFamily="Segoe UI" FontWeight="Bold" FontSize="50" Margin="50, 30, 50, 650" Opacity="0"  />
        <!-- Horizontal scrolling grid -->

        <!-- Back button and page title -->
    </Grid>
</Page>
